Count Inversions